var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (n, i) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, n) {
              e.__proto__ = n;
            }) ||
          function (e, n) {
            for (var i in n)
              Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
          })(n, i);
      };
      return function (n, i) {
        function t() {
          this.constructor = n;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        e(n, i),
          (n.prototype =
            null === i
              ? Object.create(i)
              : ((t.prototype = i.prototype), new t()));
      };
    })(),
  ZhuanZhiDialog = (function (e) {
    function n() {
      var n = e.call(this) || this;
      return (
        n.btn_zhuanzhi_sure.on(Laya.Event.CLICK, n, n.onZhuanZhiSureAction),
        n.btn_zhuanzhi_cancle.on(Laya.Event.CLICK, n, n.onZhuanZhiCancleAction),
        (n.radio_zhuanzhi_sex.selectHandler = new Handler(
          n,
          n.onRadioZhuanZhiSexAction
        )),
        (n.radio_zhuanzhi_zhiye.selectHandler = new Handler(
          n,
          n.onRadioProfessionAction
        )),
        WebSocketService.addListener({
          caller: n,
          code: 1002,
          method: n.onLoadZhuanZhiData,
        }),
        WebSocketService.addListener({
          caller: n,
          code: 1101,
          method: n.onLoadZhuanZhiData,
        }),
        n
      );
    }
    return (
      __extends(n, e),
      (n.showZhuanZhiDialog = function (e) {
        null == this.zhuanzhiDialog &&
          ((this.zhuanzhiDialog = new n()), (this.zhuanzhiDialog.zOrder = 1e3)),
          this.zhuanzhiDialog.popup(),
          "type_zhujiang" == e.type
            ? ((this.zhuanzhiDialog.height = 380),
              (this.zhuanzhiDialog.label_item_sex_bg.visible = !0))
            : ((this.zhuanzhiDialog.height = 300),
              (this.zhuanzhiDialog.label_item_sex_bg.visible = !1)),
          (this.zhuanzhiDialog.jsonDic = e);
      }),
      (n.prototype.onZhuanZhiSureAction = function () {
        var e = this.radio_zhuanzhi_sex.selectedIndex,
          n = this.radio_zhuanzhi_zhiye.selectedIndex + 1;
        "type_zhujiang" == this.jsonDic.type
          ? WebSocketService.send({ c: 1002, d: { type: n, sex: e } })
          : WebSocketService.send({
              c: 1101,
              d: { type: n, cid: this.jsonDic.id },
            });
      }),
      (n.prototype.onRadioZhuanZhiSexAction = function (e) {}),
      (n.prototype.onRadioProfessionAction = function (e) {}),
      (n.prototype.onLoadZhuanZhiData = function (e) {
        if ((ToastView.toastView(e.msg), 0 == e.code)) {
          if ("type_zhujiang" == this.jsonDic.type) {
            var n = this.radio_zhuanzhi_sex.selectedIndex;
            (Global.roleSex = n),
              WebSocketService.send({ c: 1e3, d: null }),
              WebSocketService.send({ c: 1130, d: null }),
              WebSocketService.send({ c: 1382, d: null }),
              Laya.stage.event("GameMainView", "exp"),
              Laya.stage.event("HomePageView", "exp");
          } else
            WebSocketService.send({ c: 1009, d: { id: this.jsonDic.id } }),
              WebSocketService.send({ c: 1119, d: null });
          this.close();
        } else this.close();
      }),
      (n.prototype.onZhuanZhiCancleAction = function () {
        this.close();
      }),
      n
    );
  })(ui.SuboardinateController.ZhuanZhiDialogUI);
